REM ######################################################################## REM # # REM # WISSoft präsentiert # REM # # REM # N L Q e d # REM # # REM # NLQ-Druckzeichen-Editor fuer STAR LC-10 # REM # # REM # (c) 1989 by Roland S. Speth # REM # # REM ######################################################################## CLEAR ,50000 SCREEN 2,640,200,2,2 WINDOW 5,"",(1,0)-(630,11),16,2 PALETTE 0,0.2,0.5,0.8: PALETTE 1,0.2,0.5,0.8 COLOR 0,1: LINE (1,0)-(630,10),1,bf SetAt 1,1: PRINT " NLQed - NLQ-DRUCKZEICHEN-EDITOR FÜR STAR LC-10 (c) by Roland S. Speth" WINDOW 4," NLQ-Zeichendefinitionen Nr.41-78",(320,14)-(630,181),16,2 WINDOW 3," NLQ-Zeichendefinitionen Nr. 1-40",(320,14)-(630,181),16,2 WINDOW 2," NLQ-Zeicheneditor",(1,14)-(310,181),16,2 PALETTE 0,0.2,0.5,0.8: PALETTE 1,0,0,0: PALETTE 2,1,1,1: PALETTE 3,1,0,0 MENU 1,0,1,"Projekt" MENU 1,1,1,"Zeichensatz laden" MENU 1,2,1,"Zeichensatz speichern" MENU 1,3,1,"Zeichensatz speichern als" MENU 1,4,1,"Zeichensatz ausdrucken" MENU 1,5,1,"Programm beenden" MENU 2,0,1,"Editieren" MENU 2,1,1,"Gewähltes Zeichen löschen" MENU 2,2,1,"Gesamten Zeichensatz löschen" MENU 2,3,1,"Gewähltes Zeichen kopieren nach" MENU 2,4,1,"Gewähltes Zeichen zeichnen" MENU 2,5,1,"Gesamten Zeichensatz zeichnen" MENU 3,0,0,"" MENU 4,0,0,"" ON MENU GOSUB Menues DIM code(78,46),ascii(78) FOR nn%=1 TO 78: code(nn%,0)=128: ascii(nn%)=nn%: NEXT nn% Abfragezeit=TIMER-3 WINDOW 2 GOSUB NeuAufbau Steuern: GOSUB Maus w%=WINDOW(0) WINDOW w% REM Umschalten zwischen Fenster 3 und 4 IF w%>2 AND x%>=294 AND y%>=160 THEN xx%=((n%-1) MOD 8)*36+11 yy%=((n%-1)\8)*30+6-150*INT(n%/41) LINE (xx%,yy%)-(xx%+32,yy%+19),0,b IF w%=4 THEN w%=3: WINDOW 3 :ELSE w%=4: WINDOW 4 IF n%\41=w%-3 THEN xx%=((n%-1) MOD 8)*36+11 yy%=((n%-1)\8)*30+6-150*INT(n%/41) LINE (xx%,yy%)-(xx%+32,yy%+19),3,b END IF GOTO Steuern END IF REM Auswahl des zu definierenden/zu ueberkopierenden Zeichens IF w%>2 AND x%>=12 AND x%<=294 AND y%>=7 AND y%<=147 THEN nn%=(w%-3)*40+8*INT((y%-7)/30)+INT((x%-12)/36)+1 IF nn%<=78 THEN n%=nn% IF n%<>altn% THEN IF KopierWarten%=0 THEN WINDOW OUTPUT 2 LINE (35,7)-(285,142),2,bf FOR y%=10 TO 125 STEP 16 FOR x%=40 TO 260 STEP 20 LINE (x%,y%)-(x%+20,y%+16),1,b NEXT x% NEXT y% END IF WINDOW OUTPUT 3+INT(altn%/41) xx%=((altn%-1) MOD 8)*36+11 yy%=((altn%-1)\8)*30+6-150*INT(altn%/41) LINE (xx%,yy%)-(xx%+32,yy%+19),0,b WINDOW OUTPUT 3+INT(n%/41) xx%=((n%-1) MOD 8)*36+11 yy%=((n%-1)\8)*30+6-150*INT(n%/41) LINE (xx%,yy%)-(xx%+32,yy%+19),3,b END IF IF KopierWarten%=1 THEN LINE (xx%+1,yy%+1)-(xx%+31,yy%+18),2,bf ascii(n%)=ascii(altn%) FOR Index%=0 TO 46 code(n%,Index%)=code(altn%,Index%) NEXT Index% SetAt xx%-3,yy%+21: PRINT ascii(n%);SPACE$(4-LEN(STR$(ascii(n%)))) END IF FOR Durchg%=1 TO 2 FOR Index%=1 TO 23 code=code(n%,Index%+23*Durchg%-23) FOR CodeExp%=7 TO 0 STEP -1 IF code-2^CodeExp%>=0 THEN code=code-2^CodeExp% IF KopierWarten%=1 THEN xx%=15+Index%+36*((n%-1) MOD 8) yy%=21-CodeExp%*2+Durchg%+30*((n%-1)\8)-150*INT(n%/41) IF n%<41 THEN WINDOW 3 :ELSE WINDOW 4 PSET (xx%,yy%),1 ELSE xx%=Index%*10+41 yy%=(6-CodeExp%)*16+8*Durchg%+26 WINDOW OUTPUT 2 FOR r%=1 TO 6: CIRCLE(xx%,yy%),r%,3,,,0.44: NEXT r% END IF END IF NEXT CodeExp% NEXT Index% NEXT Durchg% altn%=n% IF KopierWarten%=1 THEN KopierWarten%=0 WINDOW OUTPUT 2 SetAt 40,148 : PRINT "ASCII-Code: ";ascii(n%);SPACE$(19) END IF IF KopierWarten%=1 THEN Steuern REM Aendern der ASCII-Zuordnung IF w%=2 AND x%>=46 AND x%<=275 AND y%>=148 AND y%<=160 AND TIMER-Abfragezeit>3 THEN ASCIIeingabe: SetAt 40,148 : PRINT "ASCII-Code: ";ascii(n%);SPACE$(19) SetAt 144,148: LINE INPUT in$ IF in$<>"" THEN IF VAL(in$)<1 OR VAL(in$)>255 THEN ASCIIeingabe ascii(n%)=INT(VAL(in$)) END IF WINDOW OUTPUT 2 SetAt 40,148 : PRINT "ASCII-Code: ";ascii(n%);SPACE$(19) xx%=((n%-1) MOD 8)*36+7 yy%=((n%-1)\8)*30+27-150*INT(n%/41) WINDOW OUTPUT 3+INT(n%/41) SetAt xx%,yy%: PRINT ascii(n%);SPACE$(4-LEN(STR$(ascii(n%)))) WINDOW 2 END IF REM Zeichendefinition im Editorfenster IF w%=2 AND x%>=46 AND x%<=275 AND y%>=15 AND y%<=142 THEN CodeExp%=8-INT((y%+1)/16) Durchg%=INT(9.25-(y%+6)/16)-INT(9.25-(y%+14)/16)+1 Index%=INT((x%-36)/10) xx%=Index%*10+41 yy%=(6-CodeExp%)*16+8*Durchg%+26 WINDOW 2 f%=POINT(xx%,yy%) IF f%=3 THEN f%=2 :ELSE f%=3 FOR r%=1 TO 6: CIRCLE(xx%,yy%),r%,f%,,,0.44: NEXT r% IF Durchg%=2 AND f%=2 THEN LINE(xx%-6,yy%)-(xx%+6,yy%),1 IF Index% MOD 2=0 AND f%=2 THEN LINE(xx%-1,yy%-4)-(xx%-1,yy%+4),1 xx%=15+Index%+36*((n%-1) MOD 8) yy%=21-CodeExp%*2+Durchg%+30*((n%-1)\8)-150*INT(n%/41) IF n%<41 THEN WINDOW OUTPUT 3 :ELSE WINDOW OUTPUT 4 IF f%=3 THEN f%=1 :ELSE f%=2 PSET (xx%,yy%),f% WINDOW 2 IF f%=1 THEN CodePlus%=2^CodeExp% :ELSE CodePlus%=-2^CodeExp% code(n%,Index%+23*Durchg%-23)=code(n%,Index%+23*Durchg%-23)+CodePlus% END IF GOTO Steuern END NeuAufbau: WINDOW OUTPUT 2 LINE (35,7)-(285,142),2,bf FOR y%=10 TO 125 STEP 16 FOR x%=40 TO 260 STEP 20 LINE (x%,y%)-(x%+20,y%+16),1,b NEXT x% NEXT y% SetAt 40,148 : PRINT "ASCII-Code: ";1;SPACE$(19) n%=0 WINDOW OUTPUT 3 FOR y%=7 TO 127 STEP 30 FOR x%=12 TO 264 STEP 36 n%=n%+1 LINE (x%-1,y%-1)-(x%+31,y%+18),0,b LINE (x%,y%)-(x%+30,y%+17),2,bf SetAt x%-4,y%+20: PRINT ascii(n%);SPACE$(4-LEN(STR$(ascii(n%)))) NEXT x% NEXT y% LINE (294,160)-(294,168),1 LINE -(310,160),1 LINE -(294,160),1 LINE (11,6)-(43,25),3,b WINDOW OUTPUT 4 FOR y%=7 TO 127 STEP 30 FOR x%=12 TO 264-72*INT(y%/127) STEP 36 n%=n%+1 LINE (x%-1,y%-1)-(x%+31,y%+18),0,b LINE (x%,y%)-(x%+30,y%+17),2,bf SetAt x%-4,y%+20: PRINT ascii(n%);SPACE$(4-LEN(STR$(ascii(n%)))) NEXT x% NEXT y% LINE (294,160)-(294,168),1 LINE -(310,160),1 LINE -(294,160),1 altn%=1 n%=1 RETURN Laden: GOSUB Sicherheit IF ok=0 THEN LadeEnde NeuName: WINDOW 2 SetAt 40,148 : PRINT "Dateiname: "Dateiname$+SPACE$(23-LEN(Dateiname$)) SetAt 128,148: LINE INPUT in$ IF in$<>"" THEN Dateiname$=in$ IF Dateiname$="" THEN BEEP: GOTO LadeEnde IF LEN(Dateiname$)>23 THEN BEEP: Dateiname$="": GOTO NeuName OPEN Dateiname$ FOR INPUT AS #2 FOR n%=1 TO 78 INPUT #2,ascii(n%) FOR Index%=0 TO 46 INPUT #2,code(n%,Index%) NEXT Index% NEXT n% CLOSE #2 n%=1 GOSUB NeuAufbau GOSUB Zeichnen LadeEnde: WINDOW 2 SetAt 40,148 : PRINT "ASCII-Code: ";ascii(n%);SPACE$(19) RETURN SpeichernAls: WINDOW 2 SetAt 40,148 : PRINT "Dateiname: "Dateiname$+SPACE$(23-LEN(Dateiname$)) SetAt 128,148: LINE INPUT in$ IF in$<>"" THEN Dateiname$=in$ Speichern: IF Dateiname$="" OR LEN(Dateiname$)>23 THEN BEEP: Dateiname$="": GOTO SpeichernAls OPEN Dateiname$ FOR OUTPUT AS #2 FOR nn%=1 TO 78 PRINT #2,ascii(nn%) FOR Index%=0 TO 46 PRINT #2,code(nn%,Index%) NEXT Index% NEXT nn% CLOSE #2 WINDOW OUTPUT 2 SetAt 40,148 : PRINT "ASCII-Code: ";ascii(n%);SPACE$(19) RETURN Drucken: WINDOW OUTPUT 2 SetAt 40,148: PRINT "Moment bitte..." Drucknr=Drucknr+1 IF Drucknr=1 THEN OPEN "par:" FOR OUTPUT AS #1 LEN=1 PRINT #1,CHR$(27);"x1"; PRINT #1,CHR$(27);":";CHR$(0);CHR$(0);CHR$(0); END IF PRINT #1,CHR$(27);"&";CHR$(0);CHR$(60);CHR$(137); FOR ascii=60 TO 137 FOR Index%=0 TO 46 PRINT #1,CHR$(code(ascii-59,Index%)); NEXT Index% NEXT ascii PRINT #1,"" PRINT #1,CHR$(27);"%1"; FOR ascii=60 TO 137 PRINT #1,CHR$(ascii); NEXT ascii PRINT #1," " WINDOW OUTPUT 2 SetAt 40,148 : PRINT "ASCII-Code: ";ascii(n%);SPACE$(19) RETURN EinzelLoeschen: GOSUB Sicherheit IF ok=0 THEN EinzelLoeschEnde FOR Index%=1 TO 46 code(n%,Index%)=0 NEXT Index% ascii(n%)=n% WINDOW OUTPUT 2 LINE (35,7)-(285,142),2,bf FOR y%=10 TO 125 STEP 16 FOR x%=40 TO 260 STEP 20 LINE (x%,y%)-(x%+20,y%+16),1,b NEXT x% NEXT y% xx%=((n%-1) MOD 8)*36+12 yy%=((n%-1)\8)*30+7-150*INT(n%/41) WINDOW OUTPUT 3+INT(n%/41) LINE (xx%,yy%)-(xx%+30,yy%+17),2,bf SetAt xx%-4,yy%+20: PRINT ascii(n%);SPACE$(4-LEN(STR$(ascii(n%)))) EinzelLoeschEnde: WINDOW OUTPUT 2 SetAt 40,148 : PRINT "ASCII-Code: ";ascii(n%);SPACE$(19) RETURN AllesLoeschen: GOSUB Sicherheit IF ok=0 THEN AllesLoeschEnde FOR n%=1 TO 78 FOR Index%=1 TO 46 code(n%,Index%)=0 NEXT Index% ascii(n%)=n% xx%=((n%-1) MOD 8)*36+12 yy%=((n%-1)\8)*30+7-150*INT(n%/41) WINDOW OUTPUT 3+INT(n%/41) LINE (xx%,yy%)-(xx%+30,yy%+17),2,bf LINE (xx%-1,yy%-1)-(xx%+31,yy%+18),0,b NEXT n% AllesLoeschEnde: WINDOW OUTPUT 2 SetAt 40,148: PRINT "ASCII-Code: ";1;SPACE$(19) RETURN NeuAufbau KopierenNach: WINDOW OUTPUT 2 SetAt 40,148: PRINT "Wohin kopieren?"+SPACE$(19) KopierWarten%=1 RETURN Steuern Ende: GOSUB Sicherheit IF ok=0 THEN EndeEnde CLOSE MENU RESET WINDOW CLOSE 4 WINDOW CLOSE 3 WINDOW CLOSE 2 SCREEN CLOSE 2 END EndeEnde: WINDOW OUTPUT 2 SetAt 40,148 : PRINT "ASCII-Code: ";ascii(n%);SPACE$(19) RETURN EinzelZeichnen: FOR Durchg%=1 TO 2 FOR Index%=1 TO 23 code=code(n%,Index%+23*Durchg%-23) FOR CodeExp%=7 TO 0 STEP -1 IF code-2^CodeExp%>=0 THEN code=code-2^CodeExp% xx%=15+Index%+36*((n%-1) MOD 8) yy%=21-CodeExp%*2+Durchg%+30*((n%-1)\8)-150*INT(n%/41) WINDOW 3+INT(n%/41) PSET (xx%,yy%),1 END IF NEXT CodeExp% NEXT Index% NEXT Durchg% RETURN Zeichnen: WINDOW OUTPUT 2 SetAt 40,148 : PRINT "Zeichnen: 300 s, [ESC] Abbruch" FOR nn%=1 TO 78 xx%=((nn%-1) MOD 8)*36+12 yy%=((nn%-1)\8)*30+7-150*INT(nn%/41) WINDOW OUTPUT 3+INT(nn%/41) LINE (xx%,yy%)-(xx%+30,yy%+17),2,bf COLOR 3: SetAt xx%-4,yy%+20 PRINT ascii(nn%);SPACE$(4-LEN(STR$(ascii(nn%)))) FOR Durchg%=1 TO 2 FOR Index%=1 TO 23 code=code(nn%,Index%+23*Durchg%-23) FOR CodeExp%=7 TO 0 STEP -1 IF code-2^CodeExp%>=0 THEN code=code-2^CodeExp% IF nn%=n% THEN xx%=Index%*10+41 yy%=(6-CodeExp%)*16+8*Durchg%+26 WINDOW OUTPUT 2 FOR r%=1 TO 6: CIRCLE(xx%,yy%),r%,3,,,0.44: NEXT r% END IF xx%=15+Index%+36*((nn%-1) MOD 8) yy%=21-CodeExp%*2+Durchg%+30*((nn%-1)\8)-150*INT(nn%/41) IF nn%<41 THEN WINDOW 3 :ELSE WINDOW 4 PSET (xx%,yy%),1 in$=INKEY$ IF in$=CHR$(27) THEN xx%=((nn%-1) MOD 8)*36+12 yy%=((nn%-1)\8)*30+7-150*INT(nn%/41) COLOR 1: SetAt xx%-4,yy%+20 PRINT ascii(nn%);SPACE$(4-LEN(STR$(ascii(nn%)))) GOTO ZeichenEnde END IF END IF NEXT CodeExp% IF nn%<41 THEN WINDOW 3 :ELSE WINDOW 4 in$=INKEY$ IF in$=CHR$(27) THEN xx%=((nn%-1) MOD 8)*36+12 yy%=((nn%-1)\8)*30+7-150*INT(nn%/41) COLOR 1: SetAt xx%-4,yy%+20 PRINT ascii(nn%);SPACE$(4-LEN(STR$(ascii(nn%)))) GOTO ZeichenEnde END IF NEXT Index% NEXT Durchg% xx%=((nn%-1) MOD 8)*36+12 yy%=((nn%-1)\8)*30+7-150*INT(nn%/41) WINDOW OUTPUT 3+INT(nn%/41) COLOR 1: SetAt xx%-4,yy%+20 PRINT ascii(nn%);SPACE$(4-LEN(STR$(ascii(nn%)))) NEXT nn% ZeichenEnde: WINDOW 2 RETURN Sicherheit: WINDOW 2 SetAt 40,148: PRINT "[Auf geht's] [Bloß nicht]" Mausfragen: GOSUB Maus IF WINDOW(0)<>2 OR x%<40 OR x%>275 OR y%<148 OR y%>160 THEN Mausfragen IF x%<=158 THEN ok=1 :ELSE ok=0 SetAt 40,148 : PRINT "ASCII-Code: ";ascii(n%);SPACE$(19) Abfragezeit=TIMER RETURN Maus: Warten1: Status=MOUSE(0): IF Status<0 THEN Warten1 MENU ON Warten2: Status=MOUSE(0): IF Status=0 THEN Warten2 MENU OFF x%=MOUSE(1): y%=MOUSE(2) RETURN Menues: ON MENU(0) GOTO Menue1,Menue2 Menue1: ON MENU(1) GOSUB Laden,Speichern,SpeichernAls,Drucken,Ende GOTO MenueEnde Menue2: ON MENU(1) GOSUB EinzelLoeschen,AllesLoeschen,KopierenNach,EinzelZeichnen,Zeichnen MenueEnde: RETURN SUB SetAt (a%,b%) STATIC a1&=WINDOW(8)+36 a2&=WINDOW(8)+38 POKEW a1&,a% POKEW a2&,b%+6 END SUB